<template>
	<view>
		<view class="padding">
			<custom-input icon="cuIcon-likefill" holder="输入您的账号"></custom-input>
		</view>
	</view>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import {ID,KEY,BASE} from '../../config/index'
import http from '../../utils/http'
import type {CompanyType} from '../../model/company'
import HttpClient from '../../js_sdk/my-request/index'
// 方法1：
// uni.request({
// 	url:'https://xv1cbgpc.lc-cn-n1-shared.com/1.1/classes/company',
// 	header:{
// 		"X-LC-Id": ID,
// 		"X-LC-Key": KEY,
// 		"Content-Type": "application/json"
// 	},
// 	success: (res) => {
// 		console.log(res);
// 	}
// })

// 方法2:三方库网络请求

const list = ref<Array<CompanyType>>([])
// http.get('/classes/company').then(res=>{
// 	console.log('三方库',res);
// 	list.value = res.data.results
// })

// 方法3: 使用自定义封装的方法
let httpClient = new HttpClient({
	baseURL:BASE+'/1.1',
	header:{
		"X-LC-Id": ID,
		"X-LC-Key": KEY,
		"Content-Type": "application/json"
	}
})

httpClient.get('/classes/company').then((res:any)=>{
	console.log('自定义网络请求',res);
	list.value = res.data.results
})


</script>

<style>
	       
</style>
